<section class="content-header">
    <h1>添加检票员</h1>
</section>

<section class="content">
    <div class="box box-primary">
        <form class="form-horizontal" name="inspectors_creat_form" novalidate="novalidate" ng-submit="inspectorsCreatForm()">
            <div class="box-body">
                <div class="form-group pt7" ng-class="{'has-success': inspectors_creat_form.name.$dirty && inspectors_creat_form.name.$valid && !inspectors_creat_form.name.$focused, 'has-error': inspectors_creat_form.name.$dirty && inspectors_creat_form.name.$invalid && !inspectors_creat_form.name.$focused}">
                    <label for="name" class="col-sm-2 control-label">检票员名字</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="name" name="name" ng-model="inspector.name" placeholder="检票员名字" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': inspectors_creat_form.mobile.$dirty && inspectors_creat_form.mobile.$valid && !inspectors_creat_form.mobile.$focused, 'has-error': inspectors_creat_form.mobile.$dirty && inspectors_creat_form.mobile.$invalid && !inspectors_creat_form.mobile.$focused}">
                    <label for="mobile" class="col-sm-2 control-label">手机号</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" id="mobile" name="mobile" ng-model="inspector.mobile" placeholder="手机号(添加成功后会发送短信到该手机)" ng-pattern="/^1(3\d|5[012356789]|8[03456789])\d{8}$/" ng-focus required />
                    </div>
                </div>
                <div class="form-group pt7" ng-class="{'has-success': inspectors_creat_form.region_id.$dirty && inspectors_creat_form.region_id.$valid && !inspectors_creat_form.region_id.$focused, 'has-error': inspectors_creat_form.region_id.$dirty && inspectors_creat_form.region_id.$invalid && !inspectors_creat_form.region_id.$focused}">
                    <label for="mobile" class="col-sm-2 control-label">所在景区</label>
                    <div class="col-sm-9">
                        <select class="form-control" id="region_id" name="region_id" ng-model="inspector.region_id" ng-options="region.region_id as region.name for region in regions" required>
                            <option value="">选择景区</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="box-footer">
                <button type="submit" class="btn btn-primary pull-right" ng-disabled="inspectors_creat_form.$invalid">添加</button>
            </div>
        </form>
    </div>
</section>